import axiosInstance from '/@/request/axios.ts';

/**
 * 登录注册相关api
 */
export const AuthApi = {
  /**
   * 登录
   * @param data
   */
  login: (data: LoginType) => {
    return axiosInstance({
      url: '/sysUser/login',
      method: 'post',
      data,
    })
  },

  /**
   * 获取登录用户信息
   */
  getLoginUser: () => {
    return axiosInstance({
      url: '/sysUser/getLoginUser',
      method: 'post',
    })
  },

  /**
   * 退出登录
   */
  logout: () => {
    return axiosInstance({
      url: '/sysUser/logout',
      method: 'post',
    })
  },
}

export interface LoginType {
  account: string
  password: string
}
